<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>数据抓取工具</title>
    <link rel="stylesheet" href="scrape_eco.css">
</head>
<body>
    <button id="startScrape">开始抓取数据</button>
    <div id="progressContainer">
        <div id="progressBar"></div>
    </div>
    <script>
        document.getElementById('startScrape').addEventListener('click', async () => {
            try {
                // 开始抓取
                await window.electronAPI.startScrape();
            } catch (error) {
                console.error('抓取失败:', error);
            }
        });

        // 监听进度更新
        window.electronAPI.onProgressUpdate((progress) => {
            const progressBar = document.getElementById('progressBar');
            progressBar.style.width = `${progress}%`;
        });
    </script>
</body>
</html>
